{extend name="public/best"/}
{block name="title"}
{:lang('Forget')}
{/block}
{block name="main"}
        <div class="login-main">
            <div class="layui-elip">{:lang('Forget')}</div>
            <form class="layui-form" action="{:url('forget')}">
                {:token()}
                <div class="layui-form-item">
                    <label class="layui-form-label">找回方式</label>
                    <div class="layui-input-block">
                        <input type="radio" name="type" value="email" title="{:lang('email')}" checked lay-filter="type" data-send-url="{:url('api/ems/send')}">
                        <input type="radio" name="type" value="mobile" title="{:lang('phone')}" lay-filter="type" data-send-url="{:url('api/sms/send')}">
                    </div>
                </div>
                <div class="layui-form-item" data-type="email">
                    <div class="layui-input-inline input-item">
                        <input type="text" name="email" lay-verify="email|required" autocomplete="off" placeholder="{:lang('email')}" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item layui-hide" data-type="mobile">
                    <div class="layui-input-inline input-item">
                        <input type="text" name="mobile" lay-verify="" autocomplete="off" placeholder="{:lang('phone')}" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-input-inline input-item" style="width: 50%">
                        <input type="text" name="captcha" lay-verify="required" autocomplete="off" placeholder="{:lang('captcha')}" class="layui-input">
                    </div>
                    <button class="layui-btn btn-captcha layui-btn-primary" type="button" data-event="resetpwd" data-type="email" data-url="{:url('api/ems/send')}">{:lang('GetVerificationCode')}</button>
                </div>
                <div class="layui-form-item">
                    <div class="layui-input-inline input-item">
                        <input type="password" name="newpassword" lay-verify="required" autocomplete="off" placeholder="{:lang('NewPassword')}" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-input-inline login-btn">
                        <button class="layui-btn layui-btn-danger" lay-submit>{:lang('submit')}</button>
                    </div>
                </div>
                <div class="layui-trans layui-form-item layadmin-user-login-other">
                    {:lang('HaveAccount')}！<a href="{:url('login')}" class="layadmin-user-jump-change layadmin-link">{:lang('login')}</a>
                </div>
            </form>
        </div>
{/block}
{block name="js"}
    <script type="text/javascript">
    layui.use(['form', 'layer','yznForm'], function() {
        var form = layui.form,
            layer = layui.layer,
            yznForm = layui.yznForm;
            
            yznForm.listen('', function (res) {
                layer.msg(res.msg, {
                    offset: '15px',
                    icon: 1,
                    time: 1000
                }, function() {
                    window.location.href = res.url;
                });
                return false;
            });
    });
    </script>
{/block}